﻿/// <reference path="../../../../Scripts/jquery-1.7.1.min.js" />
var ObjectNews = new function () {
    this.TagPanelListCategoryNews = ".panel-news";
    this.TagUlCategory = ".category";
    this.TagLiActive = "li.active";
    this.ClassLiActive = "active";
    this.TagA = ".category li a";
    this.PanelDislay = "";
    this.TagPanelContentNews = ".panel-content-news";
    this.TagPanelContentNewsDisplay = ".panel-content-news-active";
    this.ClassPanelContentNewsDisplay = "panel-content-news-active";
    this.installed = function () {

        $(ObjectNews.TagUlCategory).each(function () {
            $(this).find('li').eq(1).addClass('active');
        })
        $(ObjectNews.TagUlCategory).each(function () {
            ObjectNews.PanelDislay = $(this).find('a').attr('title');
            $('.' + ObjectNews.PanelDislay).addClass(ObjectNews.ClassPanelContentNewsDisplay);
        })
    }
}
$(document).ready(function () {
    $(ObjectNews.TagA).hover(function () {
        ObjectNews.PanelDislay = $(this).parent('li').parent('ul').find('li.active').find('a').attr('title');
        $('.' + ObjectNews.PanelDislay).removeClass(ObjectNews.ClassPanelContentNewsDisplay);
        $(this).parent('li').parent('ul').find('li.active').removeClass(ObjectNews.ClassLiActive);
        $(this).parent('li').addClass(ObjectNews.ClassLiActive);
        ObjectNews.PanelDislay = $(this).attr('title');
        $('.' + ObjectNews.PanelDislay).addClass(ObjectNews.ClassPanelContentNewsDisplay);

    }, function () {

    })
})